/**
 * 
 */
package com.java.test.paymanage.dto;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;

import org.springframework.jdbc.core.RowMapper;

/**
 * @author 支付类型
 *
 */
public class PayTypeInfo implements RowMapper<PayTypeInfo> {

	// 主键id
	private int id;
	
	// 排序id
	private int sort=0;

	// 支付类型名称
	private String payTypeName;

	// 添加人
	private String addName;

	// 添加时间
	private LocalDateTime addTime;
	
	// 状态
	private int status;

	// 备注
	private String content;

	
	
	
	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getPayTypeName() {
		return payTypeName;
	}

	public void setPayTypeName(String payTypeName) {
		this.payTypeName = payTypeName;
	}

	public String getAddName() {
		return addName;
	}

	public void setAddName(String addName) {
		this.addName = addName;
	}

	public LocalDateTime getAddTime() {
		return addTime;
	}

	public void setAddTime(LocalDateTime addTime) {
		this.addTime = addTime;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	

	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}

	@Override
	public PayTypeInfo mapRow(ResultSet rs, int rowNum) throws SQLException {

		PayTypeInfo info = new PayTypeInfo();

		info.setId(rs.getInt("id"));
		info.setAddName(rs.getString("add_name"));
		info.setAddTime(rs.getTimestamp("add_time") == null ? null
				: rs.getTimestamp("add_time").toInstant().atZone(ZoneOffset.ofHours(8)).toLocalDateTime());
		info.setContent(rs.getString("content"));
		info.setPayTypeName(rs.getString("pay_type_name"));
		info.setSort(rs.getInt("sort"));
		info.setStatus(rs.getInt("status"));
		
		return info;
	}

}
